/*******************************************************************
 * 
 *  Copyright C 2005 by Amlogic, Inc. All Rights Reserved.
 *
 *  Description: 
 *			LogoEvent.h ;
 *  Author: Amlogic Software
 *  Created: Fri Nov 11 01:17:34 2005
 *
 *******************************************************************/
#ifndef __LOGOEVENT_H_
#define __LOGOEVENT_H_

#define MAX_DIR_PATH_LENGTH		256
#define AUDIO 	0x1
#define VIDEO 	0x2
#define TXT     0x3
#define PHOTO   0x4
#define UNROLL 	0x0 
#define ROLL 	0x1 
#define MUTE 	0
#define UNMUTE 	1

extern char gCurFileName[MAX_DIR_PATH_LENGTH] ;
extern char gCurDirName[MAX_DIR_PATH_LENGTH] ;
extern INT8U ucCopyFileFlag;
extern INT8U ucUseUsbFlag;
//extern INT8U ismov_flag;
extern INT32U gGetFileType;
//extern AVTimer_t preview_switch_timer;

typedef enum
{
    VIDEO_STOP_PLAY =0,
    VIDEO_NORMAL_PLAY,
    VIDEO_PAUSE_PLAY ,
    VIDEO_READY_PLAY,
    VIDEO_FF1_PLAY ,
    VIDEO_FF2_PLAY ,
    VIDEO_FF3_PLAY ,
    VIDEO_FB1_PLAY ,
    VIDEO_FB2_PLAY ,
    VIDEO_FB3_PLAY ,
}VIDEO_STATUS_t;


typedef struct {
    char file_name[256];
    int file_size;
    char file_type[10];
	unsigned long time;
} FILEINFO;

#ifdef RESUME_PLAY
typedef struct {
	unsigned long time;
    char file_name[RESUME_FILENAME_LENGTH];
}RESUME_FILEINFO;
#endif

void SaveCurrentPath();
char *GetSavedPath();

// void disable_video_layer(void);
INT8U GetVideoInfo(char *file_name, VIDEO_INFO *info);

INT8U GetDecibleVal(int v);

int ProcessVolume_Common(int flag);

unsigned char osdsettpval(unsigned char num,unsigned char level);

void run_video_preview (void);

void ClearPanelAction(INT32U *key_value);
void FileListInitData() ;

void ClearFileMaskFlag();

INT32S SetGetFileType(INT32U type) ;

INT32S GetNextFileListCB(INT32S start_pos, INT8U get_num, TFILELISTITEM *entry_lists) ;

INT32S GetPrevFileListCB(INT32S start_pos, INT8U get_num, TFILELISTITEM *entry_lists) ;

INT32S CDNewDir(INT32S entry_pos) ;

char *GetFullName(INT32S entry_pos , INT32U *entry_type);

INT32S CDRootDir(INT8U list_num, TFILELISTITEM *entry_lists) ;

INT32S CDRootDir_OnlyDir(INT8U list_num, TFILELISTITEM *entry_lists);

INT32S FileListViewOnShow(PHWND hwnd, INT32S lpParam) ;

INT32S MusicSelectMaskIconOnKeyPress(PHWND hwnd, INT32S lpParam);

INT32S MovieSelectMaskIconOnKeyPress(PHWND hwnd, INT32S lpParam);

INT32S TextSelectMaskIconOnKeyPress(PHWND hwnd, INT32S lpParam);
INT32S PicSelectMaskIconOnKeyPress(PHWND hwnd, INT32S lpParam);

INT32S OperSelectMaskIconOnKeyPress(PHWND hwnd, INT32S lpParam);

INT32S SetupSelectMaskIconOnKeyPress(PHWND hwnd, INT32S lpParam);

INT32S LogoOnShow(PHWND hwnd, INT32S lpParam) ;

void String_Init_Time();

int Get_FileInfo(char * filename);

void ChangeOutputMode();

INT32S Media_FileList_BK_PanelOnShow(PHWND hwnd, INT32S lpParam);

INT32S MediaToplOnShow(PHWND hwnd, INT32S lpParam);

INT32S gPlayerAppShowAudioID3Info();

void UpdateMusicTime(INT32S Time, INT32S TotalTime);

void gPlayerUpdateAudioTotalTime(INT32S total_time);

void UpdateAudioProcessBar(INT32S total_time, INT32S curr_time);

INT32S gAppShowVideoID3Info(char *FileName, INT8U WinChoiceType);

void Update_Video_PreviewScreen_Screen(int no); 

INT32S Video_PreviewScreen_ScreenOnShow(PHWND hwnd,INT32S lpParam) ;

INT32S FileListViewOnOtherEvent(PHWND hwnd, INT32U msg_type, INT32S lpParam);

INT32S Music_FileInfo_PanelOnPaint(PHWND hwnd, INT32S lpParam);

void UpDateSpectrumDisplay(int *Data_Arrow);

INT32S FileListKeyDown(void);

void updateAudioPlayStateWhenMsgProc(AWMSG *pMsg, INT8U ff_level, INT8U fb_level);

INT32S FileListViewOnKeyPress_nodir(PHWND hwnd, INT32S lpParam);

INT32S FileListViewOnShow_nodir(PHWND hwnd, INT32S lpParam);

void vosd_selfroll_string(PHWND hwnd, int index, char *filestring, 
	COORD opposite_play_x, COORD opposite_play_y, AVTimer_t *caption_moving_timer, 
	TIMER_CB_t caption_moving_time_func, INT32U StopRollStrLen, INT8U rolltype, INT8U IsRollShortStr);

INT8U Check_string_is_roll();

void FileListViewStringRollDelaySecond();

INT32U LogoOnHide(PHWND hwnd, INT32S lpParam);

INT32U FileListViewOnPaint(PHWND hwnd, INT32U lpParam);

INT32U MoveStringOnShow(PHWND hwnd, INT32U lpParam);

INT32U MoveStringOnPaint(PHWND hwnd, INT32U lpParam);

void UpdateIsProcessBarOnShowValue(void);

void Setkeep_current_index(INT8U keepCurrentIndex);

void ResumFromLogo();

void HomeKeyFromLogo();

char *GetCurrVideoItemName();

void GetCurrUnSupportItemName();

INT8U DlyRunMusicPlay();
#ifdef ZOOM_IN
void  AW_SetVideoZoomDown( int reduce_level);
#endif
extern void AWFillRectTxt(COORD x, COORD y, COORD width, COORD height);

#endif //__LOGOEVENT_H_
